package com.scsj.supermarket.view.activity.splashmodel;

import android.os.Bundle;

import com.scsj.supermarket.utils.RxCountDown;
import com.scsj.supermarket.view.activity.baseactivitymodel.BaseActivity;
import com.scsj.supermarket.view.activity.mainmodel.MainActivity;

import rx.Subscriber;
import rx.functions.Action0;

/**
 * 启动页
 */
public class SplashActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //单位 秒
        RxCountDown.countdown(2)
                .doOnSubscribe(new Action0() {
                    @Override
                    public void call() {//开始计时

                    }
                })
                .subscribe(new Subscriber<Integer>() {
                    @Override
                    public void onCompleted() {//计时完成
                        startActivity(MainActivity.class);
                        finish();
                    }

                    @Override
                    public void onError(Throwable e) {
                    }

                    @Override
                    public void onNext(Integer count) {//当前计时

                    }
                });
    }

    @Override
    protected void createView(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void initData() {

    }
}